package com.ccjt.efcfs.enums;

/**
 * 还款方式
 */
public enum RepayMothodTypeEnum implements IEnum<String, String> {
    // DEBJ	等额本金
    // DEBX	等额本息
    // DBDX	等本等息
    // ZQJXDQHB	按周期结息-到期还本
    // ZQJXJHHB	按周期结息-按计划还本
    // DQYCXHBFX	到期一次性还本付息
    DEBJ("debj", "等额本金", "AverageCapitalReduceInterest"),
    DEBX("debx", "等额本息", "EqualCapitalPlusInterest"),
    DBDX("dbdx", "等本等息", "AverageCapitalAverageInterest"),
    ZQJXDQHB("zqjxdqhb", "按周期结息-到期还本", "PlanInterestCloseCapital"),
    DQYCXHBFX("dqycxhbfx", "到期一次性还本付息", "ClosePlanInterestAndCapital"),
    ZQJXJHHB("zqjxjhhb", "按周期结息-按计划还本" , "PlanInterestPlanCapital"),;

    private final String key;
    private final String desc;
    private final String typeName;

    RepayMothodTypeEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
        typeName = null;
    }
    
    RepayMothodTypeEnum(String key, String desc, String typeName) {
        this.key = key;
        this.desc = desc;
        this.typeName = typeName;
    }

    public static RepayMothodTypeEnum getEnumByKey(String key) {
        return new EnumHelper<>(RepayMothodTypeEnum.class).valueOf(key);
    }

    public static RepayMothodTypeEnum getEnumByDesc(String desc) {
        RepayMothodTypeEnum enumTemp = EnumHelper.valueOfDesc(RepayMothodTypeEnum.class, desc);
        if (enumTemp == null) {
            return null;
        }
        return enumTemp;
    }

    public String getKey() {
        return key;
    }

    public String getDesc() {
        return desc;
    }

    public String getTypeName() {
        return typeName;
    }
    
}
